function store(render) {
  render._autoSave = true

  render._save = function (data) {
    console.log('saving...')
    localStorage.setItem('data', JSON.stringify(data))
  }

  render._load = function () {
    let data = null
    try {
      data = JSON.parse(localStorage.getItem('data'))
    } catch (e) {
      console.log(e)
    }

    return data
  }
}

export default store
